#!/usr/bin/env python3

import cv2 as cv
from matplotlib import pyplot as plt


ori_img = cv.imread("../pic/7.png", 0)
# 高斯金字塔
# # 上采样
# img_up = cv.pyrUp(ori_img)
# # 下采样 信息丢失
# img_down = cv.pyrDown(ori_img)
# # 下采样后上采样  模糊
# img_down_up = cv.pyrUp(cv.pyrDown(ori_img))
#
#
# cv.imshow("ori_img", ori_img)
# cv.imshow("img_up", img_up)
# cv.imshow("img_down", img_down)
# cv.imshow("img_down_up", img_down_up)
#
# cv.waitKey(0)


# 拉普拉斯金字塔
# 向下采样一次
img_down = cv.pyrDown(ori_img)
# 向上采样一次
img_down_up = cv.pyrUp(img_down)
# 原图 - 向上采样一次的图
laplace = cv.subtract(ori_img, img_down_up)

cv.imshow("ori_img", ori_img)
cv.imshow("img_down", img_down)
cv.imshow("img_down_up", img_down_up)
cv.imshow("laplace", laplace)

cv.waitKey()



















